import { Sex } from "../src/model/calory-calculator.model";
import { CaloryCalculator } from "../src/calory.calculator2";
// import { CaloryCalculator } from "../src/calory.calculator";


const {
  describe,
  it
} = require('mocha');

const {
  expect
} = require('chai');

const target = new CaloryCalculator();

describe('#热量计算测试', () => {
  describe('每日消耗热量估算', () => {
    it('#1 12岁 30公斤的男性推荐每天消耗 803卡热量', () => {
      const expected = 803;
      const actual = target.calculate(Sex.male, 12, 30);

      expect(actual).to.equal(expected);
    });

    it('#2 18岁 60公斤的男性推荐每天消耗 1592卡热量', () => {
      const expected = 1592;
      const actual = target.calculate(Sex.male, 18, 60);

      expect(actual).to.equal(expected);
    });

    it('#3 18岁 60公斤的女性推荐每天消耗 1326卡热量', () => {
      const expected = 1326;
      const actual = target.calculate(Sex.femal, 18, 60);

      expect(actual).to.equal(expected);
    });

    it('#4 30岁 79公斤的男性推荐每天消耗 1880.8卡热量', () => {
      const expected = 1880.8;
      const actual = target.calculate(Sex.male, 30, 79);

      expect(actual).to.equal(expected);
    });

    it('#5 31岁 79公斤的女性推荐每天消耗 1509.4卡热量', () => {
      const expected = 1509.4;
      const actual = target.calculate(Sex.femal, 31, 79);

      expect(actual).to.equal(expected);
    });

    it('#6 59岁 79公斤的女性推荐每天消耗 1509.4卡热量', () => {
      const expected = 1509.4;
      const actual = target.calculate(Sex.femal, 59, 79);

      expect(actual).to.equal(expected);
    });

    it('#7 60岁 60公斤的男性推荐每天消耗 1520卡热量', () => {
      const expected = 1520;
      const actual = target.calculate(Sex.male, 60, 60);

      expect(actual).to.equal(expected);
    });

    it('#8 90岁 50公斤的男性推荐每天消耗 1160卡热量', () => {
      const expected = 1160;
      const actual = target.calculate(Sex.male, 90, 50);

      expect(actual).to.equal(expected);
    });
  })
})
